import sys
import os
from os.path import join, dirname
import zc.buildout.testing
import unittest
import zope.testing
from zope.testing import doctest, renormalizing


optionflags = (doctest.ELLIPSIS |
               doctest.NORMALIZE_WHITESPACE)


def get_maildrophost_location():
    import Products.MaildropHost
    return dirname(Products.MaildropHost.__file__)


def setUp(test):
    zc.buildout.testing.buildoutSetUp(test)
    zc.buildout.testing.install_develop('ely.maildrophostmonster', test)


def test_suite():
    return unittest.TestSuite((
        doctest.DocFileSuite(
            'README.txt',
            setUp=setUp,
            tearDown=zc.buildout.testing.buildoutTearDown,
            optionflags=optionflags,
            checker=renormalizing.RENormalizing([
                zc.buildout.testing.normalize_path,
                ]),
            ),
        ))
